#!/bin/sh

# system startup.

# expand the ramdisk
/usr/bin/extract /ramfs.img /dev/ram0

# mount ramdisk, proc, sysfs
/bin/mount -t proc proc /proc
/bin/mount -t sysfs sysfs /sys

# load ext2
/sbin/insmod /lib/modules/mbcache.ko
/sbin/insmod /lib/modules/ext2.ko

# mount ramdisk
/bin/mount -t ext2 /dev/ram0 /var

# disable virtual console blanking
# /bin/echo -e '\033[9;0]\033[14;0]' > /dev/console

# enable the board leds
/bin/echo 109 > /sys/class/gpio/export
/bin/echo 110 > /sys/class/gpio/export

# set the board leds as output
/bin/echo high > /sys/class/gpio/gpio109/direction
/bin/echo high > /sys/class/gpio/gpio110/direction

# clear the board leds
/bin/echo 0 > /sys/class/gpio/gpio109/value
/bin/echo 0 > /sys/class/gpio/gpio110/value

exit 0
